﻿using System;

namespace Avalon.Core.MVC.Attributes
{
    public class RendererAttribute : Attribute
    {
        public Type RendererType { get; set; }
        public string ViewName { get; set; }
        public string FolderName { get; set; }

        public RendererAttribute(Type rendererType)
        {
            if (!typeof(IViewRenderHelper).IsAssignableFrom(rendererType)) throw new Exception("the renderer types should always implement IViewRenderHelper");
            RendererType = rendererType;
        }

        public RendererAttribute(string viewName, string folderName = "Avalon") {
            this.ViewName = viewName;
            this.FolderName = folderName;
        }
    }
}
